

********************************************************************************
* THE GOAL OF THIS DO FILE IS TO ID ALL NON-BANKS IN OUR MAIN SAMPLE
********************************************************************************
use ../Raw/Bank_Sample/BankSample_List, clear

keep BankID BankName
replace BankName = trim(BankName)
replace BankName = strlower(BankName)
gen is_bank = strpos(BankName, "bank") > 0
replace is_bank = strpos(BankName, "banco") > 0 if is_bank == 0
replace is_bank = strpos(BankName, "banque") > 0 if is_bank == 0
replace is_bank = strpos(BankName, "banca") > 0 if is_bank == 0
replace is_bank = strpos(BankName, "depot") > 0 if is_bank == 0
replace is_bank = strpos(BankName, "caja") > 0 if is_bank == 0
replace is_bank = strpos(BankName, "caixa") > 0 if is_bank == 0
replace is_bank = strpos(BankName, "credit") > 0 if is_bank == 0
replace is_bank = strpos(BankName, "bancshares") > 0 if is_bank == 0

//Dev Bank
replace is_bank = 0 if inlist(BankName, "african development bank", "agricultural development bank of china", "asian development bank", "banque de developpement des etats de l'afrique centrale [bdeac]", "west african development bank", "black sea trade & development bank [bstdb]")
replace is_bank = 0 if inlist(BankName, "central african state development bank", "china development bank [cdb]", "development bank of japan inc", "development bank of southern africa", "development bank of the philippines")
replace is_bank = 0 if inlist(BankName, "eastern & southern african trade & development bank [pta bank]", "european bank for reconstruction & development (ebrd)", "industrial development bank of india", "islamic development bank")
replace is_bank = 0 if inlist(BankName, "korea development bank", "north american development bank", "eco trade and development bank")

//Export 
replace is_bank = 0 if inlist(BankName, "african export-import bank [afreximbank]", "danish export credit fund (eksport kredit fonden (ekf))", "eksportkreditt norge as [export credit norway]", "export import bank of the united states", "export-import bank of china [china eximbank]", "export-import bank of india (eximbank india)")
replace is_bank = 0 if inlist(BankName, "export-import bank of korea (kexim)", "export-import bank of thailand", "export-import bank of the republic of china", "svensk exportkredit ab (publ) [sek] [swedish export credit corp]", "japan bank for international cooperation")
replace is_bank = 0 if inlist(BankName, "china exim bank", "indonesia eximbank", "romanian eximbank")

//Indian Banks
replace is_bank = 0 if inlist(BankName, "reserve bank of india") //Indian Central Bank
replace is_bank = 0 if inlist(BankName, "inpex", "bank of canada")



* Replace commands with only confirmed banks
replace is_bank = 1 if inlist(BankName, "atb financial", "ally financial inc", "bok financial corp", "bok financial corporation", "beal financial corp")
replace is_bank = 1 if inlist(BankName, "bryn mawr trust", "ctbc financial holding co ltd", "capital one financial corp", "cathay financial holdings co ltd", "china development financial holding corp")
replace is_bank = 1 if inlist(BankName, "citizens financial group", "daishi hokuetsu financial group inc", "first commonwealth financial corp", "first financial holding co ltd", "fubon financial holding co ltd")
replace is_bank = 1 if inlist(BankName, "fuhwa financial holding co ltd", "hana financial group inc", "hua nan financial holdings co ltd", "kb financial group inc", "lh financial group")
replace is_bank = 1 if inlist(BankName, "lakeland financial corp", "mebuki financial group inc", "mega financial holding co ltd", "midland financial co", "mitsubishi ufj financial group inc")
replace is_bank = 1 if inlist(BankName, "mizuho financial group inc", "nonghyup financial group inc", "northern trust corp", "op financial group", "svb financial group")
replace is_bank = 1 if inlist(BankName, "samba financial group", "shin kong financial holdings co ltd", "shinhan financial group", "stifel financial corp", "sumitomo mitsui financial group inc")
replace is_bank = 1 if inlist(BankName, "sumitomo mitsui trust holdings inc", "synovus financial corp", "tisco financial group pcl", "taishin financial holding co ltd", "truist financial")
replace is_bank = 1 if inlist(BankName, "woori financial holdings co ltd", "morgan stanley", "ubs ag", "wells fargo & co", "westlb", "yokohama shinkin", "abn amro")
replace is_bank = 1 if inlist(BankName, "banif", "barclays", "cit group inc", "crediop spa", "citi", "goldman sachs & co", "jp morgan")
replace is_bank = 1 if inlist(BankName, "ing group", "bnp paribas sa" )
replace is_bank = 1 if inlist(BankName, "banorte", "banreservas", "bawag", "bayernLB")
replace is_bank = 1 if inlist(BankName, "cibc", "cm-cic", "cimb group", "cimb group holdings bhd")
replace is_bank = 1 if inlist(BankName, "csob", "comerica inc", "credicorp", "dnb")
replace is_bank = 1 if inlist(BankName, "emirates nbd pjsc", "helaba", "hibernia Corp")
replace is_bank = 1 if inlist(BankName, "icbc", "icici ltd", "investec group ltd")
replace is_bank = 1 if inlist(BankName, "kbc group", "kommunalkredit austria ag", "kotak mahindra group", "kuwait finance house ksc [kfh]")
replace is_bank = 1 if inlist(BankName, "macquarie group ltd", "marshall & ilsley corp", "nibc")
replace is_bank = 1 if inlist(BankName, "nordlb group")
replace is_bank = 1 if inlist(BankName, "rhb capital bhd", "resona holdings inc", "sal oppenheim jr & cie kgaa", "shinginko tokyo", "societe generale sa", "stadtsparkasse düsseldorf")
replace is_bank = 1 if inlist(BankName, "suncorp-metway ltd", "tskb", "millennium bcp")
replace is_bank = 1 if inlist(BankName, "vtb group", "valley national corp", "washington mutual inc", "yapi kredi", "hdfc ltd")
replace is_bank = 1 if inlist(BankName, "al khaliji", "intesa sanpaolo spa [isp]", "btg pactual")
replace is_bank = 1 if inlist(BankName, "bancfirst corp", "bayernlb", "dresdner kleinwort", "stadtsparkasse dusseldorf")
replace is_bank = 1 if inlist(BankName, "rbc capital markets", "nomura holdings inc", "bmo capital markets financing inc", "portigon ag", "daewoo securities co", "jefferies", "sinopac financial holdings co ltd")

replace is_bank = 1 if inlist(BankName, "asbanda", "invesco ltd", "kakawa discount house", "marubeni corp", "merrill lynch international & co", "mitsubishi corp", "XXX", "pts financial services")


//Label Government Actors
gen gov_actor = 0
replace gov_actor = 1 if inlist(BankName, "africa finance corporation", "agence francaise de development [afd]", "arab petroleum investments corp [apicorp]", "belgian investment company for developing countries", "clean energy finance corp", "clean energy finance corporation")
replace gov_actor = 1 if inlist(BankName, "clean technology fund", "climate investment funds", "corporacion interamericana para el financiamiento de infraestructura", "credendo group", "eksport kredit fonden", "eksportfinans asa") 
replace gov_actor = 1 if inlist(BankName, "emerging africa infrastructure fund", "uk export finance [ukef]", "export development canada [edc]", "export finance & insurance corp", "giek", "government of australia")
replace gov_actor = 1 if inlist(BankName, "government of canada", "government of france", "government of india", "government of malaysia", "government of singapore", "government of the united states of america") 
replace gov_actor = 1 if inlist(BankName, "india infrastructure finance co ltd", "indian renewable energy development agency ltd", "industrial development corporation of south africa", "infrastructure development company limited [idcol]", "infrastructure development finance co ltd", "inter american investment") 
replace gov_actor = 1 if inlist(BankName, "international finance co ksc [ifc]", "japan international cooperation agency", "korea trade insurance corp (k-sure)", "multilateral investment guarantee agency [miga]", "national pension service of korea", "nippon export & investment insurance [nexi]")
replace gov_actor = 1 if inlist(BankName, "opec fund for international development [ofid]", "overseas private investment corporation", "public investment fund", "republic of indonesia", "sarana multi infrastruktur", "saudi industrial development fund") 
replace gov_actor = 1 if inlist(BankName, "sinosure", "state grid corp of china", "swedfund international", "united states department of energy", "united states department of transportation", "kingdom of thailand", "cofide", "world bank")
replace gov_actor = 1 if inlist(BankName, "power finance corp ltd", "rural electrification corp", "industrial finance corporation of india", "institut catala de finances", "korea finance corporation", "korea finance corp", "pt indonesia infrastructure finance", "pak brunei investment co ltd")
replace gov_actor = 1 if inlist(BankName, "bndes", "banobras", "kfw", "nacional financiera snc", "nederlandse financierings-maatschappij voor ontwikkelingslanden nv [fmo]")

replace gov_actor = strpos(BankName, "depositi") > 0 if gov_actor == 0
replace gov_actor = strpos(BankName, "bpd") > 0 if gov_actor == 0

replace gov_actor = 1 if inlist(BankName, "african development bank", "agricultural development bank of china", "asian development bank", "banque de developpement des etats de l'afrique centrale [bdeac]", "west african development bank", "black sea trade & development bank [bstdb]")
replace gov_actor = 1 if inlist(BankName, "central african state development bank", "china development bank [cdb]", "development bank of japan inc", "development bank of southern africa", "development bank of the philippines")
replace gov_actor = 1 if inlist(BankName, "eastern & southern african trade & development bank [pta bank]", "european bank for reconstruction & development (ebrd)", "industrial development bank of india", "islamic development bank")
replace gov_actor = 1 if inlist(BankName, "korea development bank", "north american development bank", "eco trade and development bank", "bpd south sulawesi")

replace gov_actor = 1 if inlist(BankName, "aga khan development network", "australian renewable energy agency", "government of new south wales", "national federation of fisheries cooperatives", "nigeria sovereign investment authority", "perusahaan listrik negara (pln)", "state development & investment corp (sdic)", "temasek")


replace gov_actor = 1 if inlist(BankName, "african development bank", "agricultural development bank of china", "asian development bank", "banque de developpement des etats de l'afrique centrale [bdeac]", "west african development bank", "black sea trade & development bank [bstdb]")
replace gov_actor = 1 if inlist(BankName, "central african state development bank", "china development bank [cdb]", "development bank of japan inc", "development bank of southern africa", "development bank of the philippines")
replace gov_actor = 1 if inlist(BankName, "eastern & southern african trade & development bank [pta bank]", "european bank for reconstruction & development (ebrd)", "industrial development bank of india", "islamic development bank")
replace gov_actor = 1 if inlist(BankName, "korea development bank", "north american development bank", "eco trade and development bank")

//Export 
replace gov_actor = 1 if inlist(BankName, "african export-import bank [afreximbank]", "danish export credit fund (eksport kredit fonden (ekf))", "eksportkreditt norge as [export credit norway]", "export import bank of the united states", "export-import bank of china [china eximbank]", "export-import bank of india (eximbank india)")
replace gov_actor = 1 if inlist(BankName, "export-import bank of korea (kexim)", "export-import bank of thailand", "export-import bank of the republic of china", "svensk exportkredit ab (publ) [sek] [swedish export credit corp]", "japan bank for international cooperation")
replace gov_actor = 1 if inlist(BankName, "china exim bank", "indonesia eximbank", "romanian eximbank")
replace gov_actor = 1 if inlist(BankName, "reserve bank of india") //Indian Central Bank
replace gov_actor = 1 if inlist(BankName, "inpex", "bank of canada")





// Non-financial Corporations
gen non_financial = 0
replace non_financial = 1 if inlist(BankName, "caterpillar inc", "china huaneng group", "china petrochemical corp [sinopec group]", "enel", "energy development corporation", "general electric capital corp")
replace non_financial = 1 if inlist(BankName, "hanwha corp", "henan energy and chemical industry group co ltd", "hong leong group (malaysia)", "larsen & toubro", "siemens ag", "tata sons ltd") 

replace non_financial = 1 if inlist(BankName, "tatneft oao", "total", "bhp billiton finance ltd", "bhp billiton", "bulgaria solarfarm", "chubu electric power co inc") 

replace non_financial = 1 if inlist(BankName, "eig global energy partners", "inpex", "nrg energy", "osaka gas co ltd", "phoenix american", "tokyo gas co ltd", "eurus energy")



//Private Lenders
gen asset_manager_or_pe = 0
replace asset_manager_or_pe = 1 if inlist(BankName, "aegon usa investment management", "amp ltd", "bain capital", "blackrock inc", "blackstone group lp")
replace asset_manager_or_pe = 1 if inlist(BankName, "cordiant capital", "farallon capital management llc", "federated investors", "goldentree asset management lp", "highland capital corp") 
replace asset_manager_or_pe = 1 if inlist(BankName, "kkr & co inc", "lyon capital management llc", "metrics capital partners", "nm rothschild & sons ltd", "oak hill capital partners", "silverpoint capital",  "trimaran capital partners")

replace asset_manager_or_pe = 1 if inlist(BankName, "al enma", "american capital ltd", "clifford capital", "cordiant plc", "kohlberg & co", "partners group ag", "ripplewood holdings llc", "sdic finance co ltd", "saratoga investment corp")
replace asset_manager_or_pe = 1 if inlist(BankName, "sierra clo-i", "stellus capital management", "white oak global advisors llc", "harbert management", "alvarez & marsal", "fidus investment corporation")


//Others
gen non_bank_other = gov_actor == 0 & is_bank == 0 & non_financial == 0 & asset_manager_or_pe == 0

save "../Intermediate/non_bank_list", replace






